package com.ipan.weixin.msg.send;

import com.ipan.weixin.msg.general.XmlMsg;

/**
 * 发送音乐消息
 * 
 * @author iPan
 * @version 2013-12-25
 */
public class MusicSendMsg extends AbstractSendJsonMsg {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -134056855265716722L;

	private Music music;

	public MusicSendMsg(String touser, String title, String description, String musicurl, String hqmusicurl,
			String thumb_media_id) {
		super(touser, XmlMsg.TYPE_MUSIC);
		setMusic(title, description, musicurl, hqmusicurl, thumb_media_id);
	}

	public MusicSendMsg(String touser) {
		super(touser, XmlMsg.TYPE_MUSIC);
	}

	public MusicSendMsg() {
		super(XmlMsg.TYPE_MUSIC);
	}

	public Music getMusic() {
		return music;
	}

	public void setMusic(Music music) {
		this.music = music;
	}

	public void setMusic(String title, String description, String musicurl, String hqmusicurl, String thumb_media_id) {
		this.music = new Music(title, description, musicurl, hqmusicurl, thumb_media_id);
	}

	class Music {
		private String title;
		private String description;
		private String musicurl;
		private String hqmusicurl;
		private String thumb_media_id;

		public Music() {
		}

		public Music(String title, String description, String musicurl, String hqmusicurl, String thumb_media_id) {
			this.title = title;
			this.description = description;
			this.musicurl = musicurl;
			this.hqmusicurl = hqmusicurl;
			this.thumb_media_id = thumb_media_id;
		}

		public String getTitle() {
			return title;
		}

		public void setTitle(String title) {
			this.title = title;
		}

		public String getDescription() {
			return description;
		}

		public void setDescription(String description) {
			this.description = description;
		}

		public String getMusicurl() {
			return musicurl;
		}

		public void setMusicurl(String musicurl) {
			this.musicurl = musicurl;
		}

		public String getHqmusicurl() {
			return hqmusicurl;
		}

		public void setHqmusicurl(String hqmusicurl) {
			this.hqmusicurl = hqmusicurl;
		}

		public String getThumb_media_id() {
			return thumb_media_id;
		}

		public void setThumb_media_id(String thumb_media_id) {
			this.thumb_media_id = thumb_media_id;
		}
	}

//	public static void main(String[] args) {
//		MusicServiceMsg msg = new MusicServiceMsg("OPENID", "MUSIC_TITLE", "MUSIC_DESCRIPTION", "MUSIC_URL", "HQ_MUSIC_URL", "THUMB_MEDIA_ID");
//		System.out.println(msg);
//	}

}
/*
发送： 
{
    "touser":"OPENID",
    "msgtype":"music",
    "music":
    {
      "title":"MUSIC_TITLE",
      "description":"MUSIC_DESCRIPTION",
      "musicurl":"MUSIC_URL",
      "hqmusicurl":"HQ_MUSIC_URL",
      "thumb_media_id":"THUMB_MEDIA_ID" 
    }
}
*/